import React from 'react'
import PureRenderMixin from 'react-addons-pure-render-mixin'
import { hashHistory } from 'react-router'
import './style.less'


// const modalRoot = document.getElementById('modal-root');
class Header extends React.Component <IChildProps,void>{

    constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
    }
    // componentDidMount() {
    //     modalRoot.appendChild(this.el);
    // }

    // componentWillUnmount() {
    //     modalRoot.removeChild(this.el);
    // }
    render() {
        return (
            <header >
                <div id="common-header" className="clear-fix" className={this.props.className}>
{/*                    <div className="header-fit"></div>
                    <div className="home-header-left float-left" onClick={this.backHandle.bind(this)}>
                        <i className="iconfont icon-left font18"></i>
                    </div>
                    <div className="home-header-right float-right">
                        <div>{this.props.children}</div>
                    </div>
                    <div className="home-header-middle">
                        <span className="font18">{this.props.title}</span>
                    </div>*/}
                </div>
                <div className="header-fit"></div>
                
            </header>
        )
    }
    backHandle(value) {
        const backRouter = this.props.backRouter
        if (backRouter) {
            hashHistory.push(hashHistory)
        }else{
            window.history.back();
        }
    }
}

export default Header